<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        出院登记
    </title>
    <style>
        body {
            background-color: #f9f9f9
        }

        .topTitle {
            font-size: 20px;
            line-height: 50px;
            text-align: center;
        }

        .xiangqing span {
            margin-left: 20px;
            line-height: 30px
        }

        .cy_tablelist {
            border: solid 1px #cbcbcb;
            width: 100%;
            clear: both;
        }

        .cy_tablelist th {
            /*background: url(../images/th.gif) ;*/
            background-color: #F0F5F7;
            height: 34px;
            line-height: 34px;
            text-indent: 11px;
            text-align: left;
        }
        button{
            width: 60px;
            display: inline-block;
            height: 38px;
            line-height: 38px;
            padding: 0 18px;
            background-color: #009688;
            color: #fff;
            white-space: nowrap;
            text-align: center;
            font-size: 14px;
            border: none;
            border-radius: 2px;
            cursor: pointer;

        }
    </style>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../css/x-admin.css" media="all">
    <link rel="stylesheet" href="../css/pag.css" media="all">
    <link type="text/css" rel="stylesheet" href="../js/jedate/skin/jedate.css">
    <script type="text/javascript" src="../js/jedate/src/jedate.js"></script>
</head>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>住院管理</cite></a>
              <a><cite>病人查询</cite></a>
              <a><cite>出院登记</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon"
                                                                        style="line-height:30px">ဂ</i></a>
</div>
<div class="doRecord">
    <div class="topTitle">
        <strong>出院病人登记</strong>
    </div>
    <div>
        <div class="cy-body">
                <table class="cy_tablelist" style="width: 500px" align="center">
                    <tr>
                        <th>住&nbsp;&nbsp;院&nbsp;&nbsp;号：</th>
                        <th>${zuyuandengji.userId}</th>
                    </tr>
                    <tr>
                        <th>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</th>
                        <th>${zuyuandengji.userName}</th>
                    </tr>
                    <th>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别：</th>
                    <th>
                        <c:if test="${zuyuandengji.sex eq 1}">男</c:if>
                        <c:if test="${zuyuandengji.sex eq 2}">女</c:if>
                    </th>
                    </tr>
                    <tr>
                        <th>年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;龄：</th>
                        <th>${zuyuandengji.age}</th>
                    </tr>
                    <tr>
                        <th>所属科室：</th>
                        <th>${zuyuandengji.zkName}</th>
                    </tr>
                    <tr>
                        <th>床&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</th>
                        <th>${zuyuandengji.bNo}</th>
                    </tr>
                    <tr>
                        <th>家庭地址：</th>
                        <th>${zuyuandengji.address}</th>
                    </tr>
                    <tr>
                        <th>主治医师：</th>
                        <th>${zuyuandengji.zdName}</th>
                    </tr>
                    <tr>
                        <th>入院时间：</th>
                        <th><fmt:formatDate value="${zuyuandengji.checkInTime}" pattern="YYYY-MM-dd HH:mm:ss"/></th>
                    </tr>
                    <tr>
                        <th>入院诊断：</th>
                        <th>${zuyuandengji.summary}</th>
                    </tr>
                    <tr>
                        <th>出院时间：</th>
                        <th>
                            <input type="text" name="checkOutTime" class="jeinput" id="checkOutTime" placeholder="请选择入院时间" align="center">
                            <%--<input type="text" Class="Wdate" id="checkOutTime" name="checkOutTime" readonly="readonly" onclick="WdatePicker();">--%>
                        </th>
                    </tr>
                    <tr style="height: 50px">
                        <th>出院诊断：</th>
                        <th><textarea type="text" style="width: 300px;height: 60px" name="outsumary" id="outsumary"
                                      value=""></textarea></th>
                    </tr>
                    <tr style="height: 50px">
                        <th>出院医嘱：</th>
                        <th><textarea type="text" style="width: 300px;height: 60px" name="outyz" id="outyz"
                                      value=""></textarea></th>
                    </tr>

                </table>
                <div class="providerAddBtn" align="center" style="line-height: 50px;padding-bottom: 40px">
                    <div class="chuyuanfrom">
                        <button class="chuyuanbtn" lay-submit="" id="out">确认</button>&nbsp;&nbsp;&nbsp;&nbsp;
                        <button  lay-submit="" ><a href="javascript:history.go(-1);" style="color: #fff">返回</a></button>
                    </div>
                </div>
        </div>


    </div>
</div>

<script src="../lib/layui/layui.js" charset="utf-8"></script>
<script src="../js/x-layui.js" charset="utf-8"></script>
<script src="../js/jquery2.js" charset="utf-8"></script>
<script src="../js/js.js" charset="utf-8"></script>
<script src="../js/calendar/WdatePicker.js"></script>
<script>
    layui.use(['laydate', 'element', 'laypage', 'layer'], function () {
        $ = layui.jquery;//jquery
        lement = layui.element();//面包导航
        laypage = layui.laypage;//分页
        layer = layui.layer;//弹出层
    });

    // 出院登记表提交
    $("#out").bind("click", function () {
        var uid = ${zuyuandengji.userId}
        var time = $("#checkOutTime").val();
        var summary = $("#outsumary").val();
        var yz = $("#outyz").val();
        $.ajax({
            type: "get",
            url: "/chuyuan",
            data: {checkOutTime:time,userId:uid,outsumary: yz, outyz: summary},
            dataType: "json",
            success: function (data) {
                var flag = data.retMsg;
                if (flag) {
                    layer.open({
                        title: '信息',
                        content: '办理出院成功',
                        end: function () {
                            window.location.href = "${pageContext.request.contextPath}/zycx";
                        }
                    });
                } else {
                    layer.open({
                        title: '信息',
                        content: '办理出院失败',
                        end: function () {
                            window.location.href = "${pageContext.request.contextPath}/zycx";
                        }
                    });
                }
            },
            error:function () {
                layer.msg("转科异常");
            }
        });
    })

    var enLang = {
        name: "en",
        month: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
        weeks: ["SUN", "MON", "TUR", "WED", "THU", "FRI", "SAT"],
        times: ["Hour", "Minute", "Second"],
        timetxt: ["Time", "Start Time", "End Time"],
        backtxt: "Back",
        clear: "Clear",
        today: "Now",
        yes: "Confirm",
        close: "Close"
    }
    jeDate("#checkOutTime", {
        festival: true,
        minDate: "1900-01-01",              //最小日期
        maxDate: "2099-12-31",              //最大日期
        method: {
            choose: function (params) {

            }
        },
        format: "YYYY-MM-DD hh:mm:ss"
    });
</script>
</body>
</html>